<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>管理员登录-WeAdmin Frame型后台管理系统-WeAdmin 1.0</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__STATIC__/admin/static/css/font.css">
	<link rel="stylesheet" href="__STATIC__/admin/static/css/weadmin.css">
    <script src="__STATIC__/admin/static/js/jquery3.2.1.min.js" charset="utf-8"></script>
    <script src="__STATIC__/admin/lib/layui/layui.js" charset="utf-8"></script>

</head>
<body class="login-bg">
   
    <div class="login">
        <div class="message">后台管理登陆界面</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名"  type="text" class="layui-input" >
            <hr class="hr15">
            <input name="password" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input name="code" placeholder="验证码"  type="text" class="layui-input-inline" style="width:200px"><img src="{:captcha_src()}" alt="" width="140px" class="cap">
            <hr class="hr15">
            <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>

    <script type="text/javascript">
        
        	layui.extend({
				admin: '__STATIC__/admin/static/js/admin'
			});
            layui.use(['form','admin'], function(){
              var form = layui.form
              	,admin = layui.admin;
              // layer.msg('玩命卖萌中', function(){
              //   //关闭后的操作
              //   });

              $('form').submit(function(e){
                var username=$('input[name=username]').val();
                var pwd=$('input[name=password]').val();
                var code=$('input[name=code]').val();
                e.preventDefault();
                $.ajax({
                    type: 'POST',
                    url: "{:url('admin/index/login')}",
                    dataType: 'json',
                    data:"id="+username+"&pwd="+pwd+"&code="+code,
                    success: function(data){
                        if(data.code==1){
                            layer.msg(data.msg,{icon:1,time:1000},function(){
                                location.href="{:url('admin/index/index')}";
                            });
                        }else{
                            layer.msg(data.msg,{icon:2,time:1000},function(){

                            });
                        }
                    }
                });    
              })
            });
            $('.cap').click(function(){
                $(this).attr('src',"{:captcha_src()}?"+Math.random());
            });
    </script>  
    <script type="text/javascript">
            layui.use('layer', function(){
                var layer = layui.layer;
                {if $msg != ''}
                    layer.msg("{$msg}",{icon:6,time:3000});
                {/if}
            });
            
        </script>
    <!-- 底部结束 -->
</body>
</html>